.class public final Lnbisdk/s;
.super Lnbisdk/df;

# interfaces
.implements Lnbisdk/iz;


# instance fields
.field private H:Lnbisdk/dj;

.field private I:Lnbisdk/gh;


# direct methods
.method public constructor <init>(Lnbisdk/gh;)V
    .locals 0

    invoke-direct {p0}, Lnbisdk/df;-><init>()V

    iput-object p1, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    return-void
.end method


# virtual methods
.method public final a(Lnbisdk/ad;)V
    .locals 2

    iget-boolean v0, p0, Lnbisdk/s;->cB:Z

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "Another request is in progress"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    const/4 v0, 0x1

    iput-boolean v0, p0, Lnbisdk/s;->cB:Z

    new-instance v0, Lnbisdk/dj;

    invoke-direct {v0, p1, p0}, Lnbisdk/dj;-><init>(Lnbisdk/em;Lnbisdk/iz;)V

    iput-object v0, p0, Lnbisdk/s;->H:Lnbisdk/dj;

    iget-object v0, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    invoke-interface {v0, p0}, Lnbisdk/gh;->onRequestStart(Lcom/navbuilder/nb/b;)V

    iget-object v0, p0, Lnbisdk/s;->H:Lnbisdk/dj;

    invoke-virtual {v0}, Lnbisdk/dj;->start()V

    return-void
.end method

.method public final a(Lnbisdk/dz;)V
    .locals 1

    iget-object v0, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    invoke-interface {v0, p0}, Lnbisdk/gh;->onRequestCancelled(Lcom/navbuilder/nb/b;)V

    return-void
.end method

.method public final a(Lnbisdk/dz;I)V
    .locals 1

    iget-object v0, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    invoke-interface {v0, p2, p0}, Lnbisdk/gh;->onRequestProgress(ILcom/navbuilder/nb/b;)V

    return-void
.end method

.method public final a(Lnbisdk/dz;Lcom/navbuilder/nb/NBException;)V
    .locals 1

    const/4 v0, 0x0

    iput-boolean v0, p0, Lnbisdk/s;->cB:Z

    iget-object v0, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    invoke-interface {v0, p2, p0}, Lnbisdk/gh;->onRequestError(Lcom/navbuilder/nb/NBException;Lcom/navbuilder/nb/b;)V

    return-void
.end method

.method public final a(Lnbisdk/dz;Lnbisdk/fk;)V
    .locals 12

    const/4 v0, 0x0

    :try_start_0
    iput-boolean v0, p0, Lnbisdk/s;->cB:Z

    new-instance v6, Lnbisdk/fg;

    invoke-direct {v6}, Lnbisdk/fg;-><init>()V

    invoke-virtual {p2}, Lnbisdk/fk;->ae()Ljava/util/Enumeration;

    move-result-object v7

    const/4 v0, 0x0

    move v8, v0

    :cond_0
    :goto_0
    invoke-interface {v7}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v0

    if-eqz v0, :cond_7

    invoke-interface {v7}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lnbisdk/fk;

    invoke-virtual {p1}, Lnbisdk/fk;->getName()Ljava/lang/String;

    move-result-object v0

    const-string v1, "proxmatch"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-static {p1}, Lnbisdk/la;->m(Lnbisdk/fk;)Lnbisdk/gr;

    move-result-object v0

    iget-object v1, p0, Lnbisdk/s;->H:Lnbisdk/dj;

    add-int/lit8 v2, v8, 0x1

    invoke-static {v1, v8}, Lnbisdk/la;->a(Lnbisdk/ha;I)Lnbisdk/ml;

    move-result-object v1

    invoke-virtual {v0, v1}, Lnbisdk/gr;->d(Ljava/lang/Object;)V

    invoke-virtual {v6, v0}, Lnbisdk/fg;->a(Lnbisdk/gr;)V

    move v8, v2

    goto :goto_0

    :cond_1
    const-string v1, "proxmatch-summary"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_6

    const-string v0, "count"

    invoke-static {p1, v0}, Lnbisdk/iq;->b(Lnbisdk/fk;Ljava/lang/String;)J

    move-result-wide v0

    long-to-int v1, v0

    const-string v0, "time"

    invoke-virtual {p1, v0}, Lnbisdk/fk;->e(Ljava/lang/String;)[B

    move-result-object v0

    const-wide/16 v2, 0x0

    array-length v4, v0

    const/16 v5, 0x8

    if-le v4, v5, :cond_2

    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "beunpack input too long"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    move-exception v0

    const-string v1, "Internal Exception on Event Search Handling"

    const-wide/16 v2, 0x20

    const/4 v4, 0x2

    invoke-static {v1, v2, v3, v4}, Lnbisdk/pn;->a(Ljava/lang/String;JB)V

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v1

    const-wide/16 v2, 0x20

    const/4 v4, 0x2

    invoke-static {v1, v2, v3, v4}, Lnbisdk/pn;->a(Ljava/lang/String;JB)V

    iget-object v1, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    new-instance v2, Lcom/navbuilder/nb/NBException;

    const/16 v3, 0x42

    invoke-direct {v2, v3, v0}, Lcom/navbuilder/nb/NBException;-><init>(ILjava/lang/Exception;)V

    invoke-interface {v1, v2, p0}, Lnbisdk/gh;->onRequestError(Lcom/navbuilder/nb/NBException;Lcom/navbuilder/nb/b;)V

    :goto_1
    return-void

    :cond_2
    :try_start_1
    array-length v4, v0

    const/4 v5, 0x1

    sub-int/2addr v4, v5

    const/4 v5, 0x0

    move v11, v5

    move v5, v4

    move v4, v11

    :goto_2
    if-ltz v5, :cond_3

    aget-byte v9, v0, v5

    and-int/lit16 v9, v9, 0xff

    int-to-long v9, v9

    shl-long/2addr v9, v4

    or-long/2addr v2, v9

    add-int/lit8 v5, v5, -0x1

    add-int/lit8 v4, v4, 0x8

    goto :goto_2

    :cond_3
    const-wide/16 v4, 0x0

    cmp-long v0, v2, v4

    if-gez v0, :cond_4

    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "beunpack result is negative"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_4
    const-string v0, "utc-offset"

    invoke-static {p1, v0}, Lnbisdk/ok;->i(Lnbisdk/fk;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v4

    new-instance v0, Lnbisdk/fu;

    invoke-direct/range {v0 .. v5}, Lnbisdk/fu;-><init>(IJJ)V

    const-string v1, "category"

    invoke-static {p1, v1}, Lnbisdk/ij$a;->c(Lnbisdk/fk;Ljava/lang/String;)Lnbisdk/fk;

    move-result-object v1

    invoke-static {v1}, Lnbisdk/bb;->a(Lnbisdk/fk;)Lnbisdk/iv;

    move-result-object v1

    invoke-virtual {v0, v1}, Lnbisdk/fu;->b(Lnbisdk/iv;)V

    new-instance v1, Lnbisdk/rb;

    const-string v2, "search-filter"

    invoke-static {p1, v2}, Lnbisdk/ij$a;->c(Lnbisdk/fk;Ljava/lang/String;)Lnbisdk/fk;

    move-result-object v2

    invoke-direct {v1, v2}, Lnbisdk/rb;-><init>(Lnbisdk/fk;)V

    invoke-virtual {v0, v1}, Lnbisdk/fu;->b(Lnbisdk/lg;)V

    const-string v1, "event-content"

    invoke-virtual {p1, v1}, Lnbisdk/fk;->V(Ljava/lang/String;)Ljava/util/Enumeration;

    move-result-object v1

    if-eqz v1, :cond_5

    :goto_3
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v2

    if-eqz v2, :cond_5

    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lnbisdk/fk;

    invoke-static {p1}, Lnbisdk/oc;->s(Lnbisdk/fk;)Lnbisdk/pm;

    move-result-object v2

    invoke-virtual {v0, v2}, Lnbisdk/fu;->a(Lnbisdk/pm;)V

    goto :goto_3

    :cond_5
    invoke-virtual {v6, v0}, Lnbisdk/fg;->a(Lnbisdk/fu;)V

    goto/16 :goto_0

    :cond_6
    const-string v1, "proxmatch-content"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "event-content"

    invoke-static {p1, v0}, Lnbisdk/ij$a;->c(Lnbisdk/fk;Ljava/lang/String;)Lnbisdk/fk;

    move-result-object v0

    invoke-static {v0}, Lnbisdk/oc;->s(Lnbisdk/fk;)Lnbisdk/pm;

    move-result-object v0

    new-instance v1, Lnbisdk/rb;

    const-string v2, "search-filter"

    invoke-static {p1, v2}, Lnbisdk/ij$a;->c(Lnbisdk/fk;Ljava/lang/String;)Lnbisdk/fk;

    move-result-object v2

    invoke-direct {v1, v2}, Lnbisdk/rb;-><init>(Lnbisdk/fk;)V

    invoke-virtual {v0, v1}, Lnbisdk/pm;->e(Lnbisdk/lg;)V

    invoke-virtual {v6, v0}, Lnbisdk/fg;->a(Lnbisdk/pm;)V

    goto/16 :goto_0

    :cond_7
    invoke-static {p2}, Lnbisdk/s;->b(Lnbisdk/fk;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v6, v0}, Lnbisdk/fg;->c(Ljava/lang/Object;)V

    invoke-static {p2}, Lnbisdk/s;->c(Lnbisdk/fk;)Z

    move-result v0

    invoke-virtual {v6, v0}, Lnbisdk/fg;->t(Z)V

    iget-object v0, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    invoke-interface {v0, v6, p0}, Lnbisdk/gh;->a(Lnbisdk/ol;Lnbisdk/df;)V

    iget-object v0, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    invoke-interface {v0, p0}, Lnbisdk/gh;->onRequestComplete(Lcom/navbuilder/nb/b;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_1
.end method

.method public final b(Lnbisdk/dz;)V
    .locals 1

    const/4 v0, 0x0

    iput-boolean v0, p0, Lnbisdk/s;->cB:Z

    iget-object v0, p0, Lnbisdk/s;->I:Lnbisdk/gh;

    invoke-interface {v0, p0}, Lnbisdk/gh;->onRequestTimedOut(Lcom/navbuilder/nb/b;)V

    return-void
.end method

.method public final cancelRequest()V
    .locals 1

    iget-boolean v0, p0, Lnbisdk/s;->cB:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/s;->H:Lnbisdk/dj;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/s;->H:Lnbisdk/dj;

    invoke-virtual {v0}, Lnbisdk/dj;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lnbisdk/s;->H:Lnbisdk/dj;

    :cond_0
    const/4 v0, 0x0

    iput-boolean v0, p0, Lnbisdk/s;->cB:Z

    return-void
.end method

.method public final isRequestInProgress()Z
    .locals 1

    iget-boolean v0, p0, Lnbisdk/s;->cB:Z

    return v0
.end method
